package com.ke.forum.forumapi.service.impl;

import com.ke.forum.common.common.Result;
import com.ke.forum.forumapi.service.AnnouncementService;
import com.ke.forum.mbg.entity.Announcement;
import com.ke.forum.mbg.dao.AnnouncementMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ke.forum.mbg.entity.dto.AnnouncementDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 珂
 * @since 2021-06-06
 */
@Service
public class AnnouncementServiceImpl extends ServiceImpl<AnnouncementMapper, Announcement> implements AnnouncementService {

    @Autowired
    AnnouncementMapper announcementMapper;

    @Override
    public Result listAnnouncement() {
        List<AnnouncementDto> announcementDtos = announcementMapper.listAnnouncement();
        return Result.SUCCESS(announcementDtos);
    }
}
